package com.tongzhan.controller;

import org.apache.rocketmq.spring.core.RocketMQTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class RocketMQController {

    @Autowired
    private RocketMQTemplate rocketMQTemplate;

    @RequestMapping("/sendMessage")
    public String sendMessage(){
        rocketMQTemplate.convertAndSend("sendMessage","消息中心新发布的消息");
        return "消息中心新发布的消息";
    }
}
